<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>   
    <div class="div-info-body">
      <div class="ym-g20 ym-gl">
	<h2>创建家谱</h2>
      </div>
      <div class="ym-g80 ym-gr">
	<div class="ym-gbox">
	  <form id="register" action="/family/add" method='post' class="app-family">
	    <input type="hidden" name="creator" value="<%$session.id%>"/>
	    <!-- <input type="hidden" name="roleid" value="<%$user.id%>"/> -->
	    <!-- <input type="hidden" name="rolegender" value="<%$user.gender%>"/> -->
	    <input type="hidden" name="qq_open_id" value="<%$openid%>"/>
	    <div class="div-form-line">
              <div class="div-form-label">
		省：
	      </div>
              <div class="div-form-input">
		<select required class="required" id="province_id">
		  <%$provinces%>
		</select>
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		市：
	      </div>
              <div class="div-form-input">
		<select id="city_id">
		  <%$cities%>
		</select>
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		县：
	      </div>
              <div class="div-form-input">
		<select id="town_id">
		  <%$towns%>
		</select>
                <input name="region_code" type="hidden" id="city_code" value="<%$user.region_code%>"/>
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		名称：
	      </div>
              <div class="div-form-input">
		<input required class="required" maxlength="24" type="text" name="name" value="<%$post.name%>"/>
	      </div>
              <div class="div-input-hint">
		如：河南王氏族谱。
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		简介：
	      </div>
              <div class="div-form-input">
                <textarea name="notes" maxlength="128"><%$post.notes%></textarea>
	      </div>
              <!-- <div class="div-input-hint"> -->
	      <!-- 	格式：1985-05-26，月日不详，可省略，如:1958, 1920-03 均可；公元前年份在年份前加‘-’号即可，如：“-523-02-01”，表示公元前523年2月1日 -->
	      <!-- </div> -->
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		代表人物：
	      </div>
              <div class="div-form-input">
		<input required class="required" maxlength="5" type="text" name="realname" value="<%$post.realname%>" />
	      </div>
              <div class="div-input-hint">
		该家谱将以户主作为起点呈现，可以增加户主的先人和后人。
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		代表人物性别：
	      </div>
              <div class="div-form-input">
		<label><input type="radio" required class="required" name="gender" id="male" value="<%$MALE%>" <% if $post.gender eq $male %>checked<%/if%> />男</label>
		<label><input type="radio" name="gender" id="female" value="<%$FEMALE%>" <% if $post.gender eq $female %>checked<%/if%> />女</label>
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">
		开放：
	      </div>
              <div class="div-form-input">
		<%if $open|@count gt 0%>
		<%foreach from=$open key=k item=v%>		
		<label><input type="radio" required class="required" name="open" id="<%$k%>" value="<%$k%>" 
			      <% if (!$post.open && $k eq "public") || $post.open eq $k %>checked<%/if%> /><%$v%></label><br/>
		<%/foreach%>
		<%/if%>
	      </div>
              <div class="div-input-hint">
		开放有助于亲属们分享
              </div>
	    </div>

	    <div class="div-form-line">
              <div class="div-form-label">&nbsp;
	      </div>
              <div class="div-form-input">
		<span class="error"><%$error%></span>
	      </div>
	    </div>
	    <div class="div-form-line">
              <div class="div-form-label">&nbsp;
	      </div>
              <div class="div-form-input">
                <input type="submit" value="添加"/>
	      </div>
	    </div>
	  </form>
	</div>
      </div>
    </div>
  </div>
</div>
<%include file="include/bottom.html"%>  
